<template>
  <div class="hello">{{ msg }}
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'HelloWorld',
  created() {
      let hh = new Date().getHours();
      if(hh < 12) {
        this.msg = "早"
      } else if( hh <= 13) {
        this.msg = "中午好"
      } else if( hh <= 18) {
        this.msg = "下午好"
      } else {
        this.msg = "晚上好"
      }
      axios.get('api/ip').then(res => {
        console.log(res.data)
      })
  },
  methods: {
    
    send() {
      axios.get('api/hello').then(res => {
        console.log(res.data)
      })
    }
  },
  data () {
    return {
      msg: '早上好'
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.hello {
  width: 100%;
  font-size: 400px;
  text-align: center;
}
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
